<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="Agreement Termination" >
	<h:panelGrid>
		<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
	</h:panelGrid>

	<t:panelGrid columns="2"
		columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80"
		width="100%">
		 

		<h:outputText></h:outputText>
		<t:message for="prefix" styleClass="error"></t:message>

		<h:outputText></h:outputText>
		<h:panelGrid width="100%" rendered="#{!(agentMemberBookingBean.lookupMemberForm || agentMemberBookingBean.lookupAgreementForm || agentMemberBookingBean.lookupPackageForm)}">
			<h:panelGroup> 
				<h:outputText value="*" styleClass="standardText_Mandatory" />
				<h:outputText value="#{messages['instruction']}" styleClass="standardText_Instruction" />
			</h:panelGroup>
		</h:panelGrid>
	
		<h:panelGroup>
			<h:outputLabel value="Membership No." styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
			<t:outputLabel styleClass="standardText" 
				value="#{adminAgreementTerminateBean.member.membershipNo}"></t:outputLabel>
		</h:panelGroup>
		
		<h:outputText></h:outputText>
		<t:message for="refund" styleClass="error"></t:message>
		<h:panelGroup> 
			<h:outputLabel for="refund" value="Refund To Member" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:inputText id="refund" size="10" maxlength="10" styleClass="standardText" value="#{adminAgreementTerminateBean.refundToMember}"></t:inputText>
		
		<h:outputText></h:outputText>
		<t:message for="quota" styleClass="error"></t:message>
		<h:panelGroup> 
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="quota" value="Affect Quota" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:selectOneRadio id="quota"  styleClass="standardText" value="#{adminAgreementTerminateBean.affectQuota}" required="true">
			<f:selectItems value="#{adminAgreementTerminateBean.affect}"/>
		</t:selectOneRadio>
		
		<h:outputText></h:outputText>
		
		<t:message for="commission" styleClass="error"></t:message>
		<h:panelGroup> 
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="commission" value="Affect Commission" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:selectOneRadio id="commission"  styleClass="standardText" value="#{adminAgreementTerminateBean.affectCommission}" required="true">
			<f:selectItems value="#{adminAgreementTerminateBean.affect}"/>
		</t:selectOneRadio>
		
	</t:panelGrid>
	<rich:spacer height="20" />

		<rich:dataTable id="data2" var="obj"  
			value="#{adminAgreementTerminateBean.agreements}" rows="10" width="99%"
			rowKeyVar="rowNo">
			 
			<rich:column style="text-align:center;width:20%;">
				<f:facet name="header">
					<h:outputText value="Agreement No."></h:outputText>
				</f:facet>
				<h:outputLabel value="#{obj.agreetmentNo}">
				</h:outputLabel>
			</rich:column>
			<rich:column style="text-align:center;width:20%;">
				<f:facet name="header">
					<h:outputText value="Member Name"></h:outputText>
				</f:facet>
				<t:outputText styleClass="standardText" value="#{obj.member.name}"></t:outputText>
			</rich:column>
			<rich:column style="text-align:center;width:20%;">
				<f:facet name="header">
					<h:outputText value="Agreement Date">
						<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Asia/Kuala_Lumpur" />
					</h:outputText>
				</f:facet>
				<t:outputText styleClass="standardText" value="#{obj.agreetmentDate}"></t:outputText>
			</rich:column>
			<rich:column style="text-align:center;width:20%;">
				<f:facet name="header">
					<h:outputText value="Membership Category"></h:outputText>
				</f:facet>
				<t:outputText styleClass="standardText" value="#{obj.membership.membershipCategory.name}"></t:outputText>
			</rich:column>

		</rich:dataTable>

		<rich:spacer height="30" />

		<rich:datascroller align="left" for="data2" maxPages="20" />
 		<rich:spacer height="30" />
 

		<t:panelGroup>
			<t:panelGrid columns="2" >
				<h:commandButton value="Approve" styleClass="button"
					action="#{adminAgreementTerminateBean.actionBuletinApproveTermination}"></h:commandButton>
				<h:commandButton value="Cancel Termination" styleClass="button"
					action="#{adminAgreementTerminateBean.cancelTermination}"
					immediate="true"></h:commandButton>
				<h:commandButton value="Back" styleClass="button"
					action="financePortal"
					immediate="true"></h:commandButton>
			</t:panelGrid>
		</t:panelGroup>


</rich:panel>

 